package com.wrupple.muba.catalogs.client.module.services.logic.impl;

import java.util.List;

import com.google.gwt.event.shared.EventBus;
import com.wrupple.muba.catalogs.client.events.catalog.EntriesDeletedEvent;
import com.wrupple.muba.catalogs.domain.CatalogEntry;
import com.wrupple.muba.common.client.application.DataCallback;

public class EntryDeleteServiceHook extends DataCallback<CatalogEntry> {

	private String catalog;
	private List<String> values;
	private EventBus eventBus;

	public EntryDeleteServiceHook(String catalog, List<String> values, EventBus eventBus) {
		super();
		this.catalog = catalog;
		this.values = values;
		this.eventBus = eventBus;
	}

	@Override
	public void execute() {
		if (result != null ) {
			EntriesDeletedEvent event = new EntriesDeletedEvent(values, catalog);
			eventBus.fireEvent(event);
		}
	}

}
